Repository navigation
feat(bedside): invitation expiry and fail-closed replays (BA-W01 L3) - #11786
Merged
Merged
Conversation
Invitations expire 14 days after they are made. Expiry is derived from created_at (the status CHECK predates 'expired', so no migration): the API reports 'expired' and expiresAt, the invitee list drops expired invitations, and the accept/decline compare-and-set also requires an unexpired invitation. Responding to an invitation that is no longer pending now fails closed with 409 and its status instead of answering 200. A new invitation to the same email replaces an expired one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dezren39
marked this pull request as ready for review
November 18, 2026 11:40
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: a store invitation never expired, and answering one that was already accepted, declined or revoked returned 200 with its status, so a replay looked like success.
After: an invitation expires 14 days after it is made. The invitee's list drops it, the access view shows it as
expiredwith itsexpiresAt, and accepting it fails with 409. Any response to an invitation that is no longer pending fails closed with 409 and its status. A new invitation to the same email replaces an expired one. Only the signed-in account the invitation names can answer it, as before.How: expiry is derived from
created_at(INVITE_TTL_MSinworker/api.mjs), not stored, because theinvitations.statusCHECK predatesexpired; no migration is needed. The accept/decline compare-and-set now also requirescreated_atinside the window.tests/backend.mjscovers replays after acceptance, expiry, the expired listing and re-inviting;tests/admin-races.mjsstill passes (its revoked race now reads 409 withstatus: revoked).design/identity-access.mdrecords the lifecycle. All 19 test files pass.Closes #11752.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.